package com.yaorange.module.system.controller;

import com.yaorange.module.system.entity.vo.PermissionTreeVo;
import com.yaorange.module.system.service.SysPermissionService;
import com.yaorange.response.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/sys/permission")
@Slf4j
public class SysPermissionController {
    @Autowired
    private SysPermissionService sysPermissionService;

    @GetMapping
    public Result<List<PermissionTreeVo>> findPermissionTree() {
        log.info("查询权限树");
        return Result.success(sysPermissionService.findPermissionTree());
    }

}
